package com.soul.sys.bean.vo;

import com.soul.common.bean.comm.TreeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author Shiws
 * @version 1.0
 * @date 2023/11/6 9:55
 */
@Data
@ApiModel(value = "Route对象", description = "路由")
public class RouteVo extends TreeVo<RouteVo> {
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("重定向")
    private String redirect;
    @ApiModelProperty("地址")
    private String path;
    @ApiModelProperty("组件")
    private String component;
    @ApiModelProperty("显示")
    private boolean alwaysShow;
    @ApiModelProperty("是否隐藏")
    private boolean hidden;
    @ApiModelProperty("meta")
    private Meta meta;

    public Meta setMetaTitle(String title){
        if (meta==null){
            this.meta = new Meta();
        }
        this.meta.setTitle(title);
        return meta;
    }


    @Data
    @Accessors(chain = true)
    @ApiModel(value = "Meta对象", description = "Meta")
    public static class Meta {

        @ApiModelProperty("标题")
        private String title;

        @ApiModelProperty("图标")
        private String icon;

        @ApiModelProperty("是否缓存")
        private boolean noCache;

        @ApiModelProperty("link")
        private String link;

    }
}
